<template>
    <el-container class = "home_container">
        <el-aside width="200px" style="">
            <el-menu :router='true'>
                <!--&lt;!&ndash;                :router='true'&ndash;&gt; 添加上路由-->
                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-message"></i>管理员页面</template>
                    <el-menu-item index="normal_user">普通用户列表</el-menu-item>
                    <el-menu-item index="sell_user">商家用户列表</el-menu-item>
                </el-submenu>
            </el-menu>
        </el-aside>

        <el-container>
            <el-header >
                <el-row><el-button  type = "primary" @click="logout">退出</el-button>
                </el-row>
            </el-header>
            <el-main>
                <!--                具体路由变化的页面-->
                <router-view></router-view>
            </el-main>
        </el-container>

    </el-container>
</template>
<style>
.home_container{
    height: 100%;
}

.el-header{
    background-color: #2b4b6b;
    color:#fff;
    text-align: right;
    height: 40px;
    font-size: 12px;
}

.el-button{
    height: 100%;
}
.el-aside {
    background-color: #ccc;
    height: 100%;
}

.el-main{
    background-color: #fff;
}

</style>

<script>
export default {
    data() {
        return {
        }
    },
    methods:{
        logout(){
            console.log("退出");
            window.sessionStorage.removeItem('token');
            this.$router.push('/login')
        }
    }
};
</script>
